<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Todo List</title>
  <style>${app.file('./style.css')}</style>
</head>
<body>
  <header>
    <input type="text" placeholder="Create a task..." id="itemText">
    <button id="addItem">
      <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
        <g>
          <path fill="#25b99a" d="M16,8c0,0.5-0.5,1-1,1H9v6c0,0.5-0.5,1-1,1s-1-0.5-1-1V9H1C0.5,9,0,8.5,0,8s0.5-1,1-1h6V1c0-0.5,0.5-1,1-1s1,0.5,1,1v6h6C15.5,7,16,7.5,16,8z"></path>
        </g>
      </svg>
		</button>
  </header>
  <ul class="todolist">
    ${tasks.map(({_id, text, state}) => {
      const className = state > 0 ? 'completed' : 'todo';
      const removeSVG = `${app.file('./remove.svg')}`;
      const completeSVG = `${app.file('./complete.svg')}`;
      return `<li data-id="${_id}" class="${className}">${text}<button class="remove">${removeSVG}</button><button class="complete">${completeSVG}</button></li>`;
    }).join('')}
  </ul>
  <script>const completeSVG = \`${app.file('./complete.svg')}\`;
const removeSVG = \`${app.file('./remove.svg')}\`;
${app.file('./app.client.js')}
</script>
</body>
</html>